package com;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2023-11-03
 * Time: 9:30
 */
@Controller
public class Teacher  {
    public String name;
    private String title;


    public Teacher(String name,String title) {
        this.name = name;
        this.title = title;
    }


    @Bean(name="teacherBean")
    public Teacher teacher() {
        return new Teacher("赵六","大数据");
    }
    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", title='" + title + '\'' +
                '}';
    }

    public void teaching() {
        System.out.println(this.name + "老师正在讲课");
    }
}
